package org.xfy.ymcc.feign.fallback;

import feign.hystrix.FallbackFactory;
import org.xfy.common.result.JsonResult;
import org.xfy.ymcc.domain.CourseDoc;
import org.xfy.ymcc.feign.SearchFeignClient;

import java.util.List;

public class SearchFeignClientFallbackFactory implements FallbackFactory<SearchFeignClient> {
    @Override
    public SearchFeignClient create(Throwable throwable) {
        return new SearchFeignClient() {
            @Override
            public JsonResult saveSearch(CourseDoc courseDoc) {
                return JsonResult.error("调用失败");
            }

            @Override
            public JsonResult getCourse(List<Long> courseIds) {
                return JsonResult.error("getCourse调用失败");
            }
        };
    }
}
